package com.wnxy.sddfp.system;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

/**
 * 包扫描：
 * 1、默认扫描启动类平级的包及子包；
 * 2、这里需要扫描common，因为要用到common工程的全局异常；
 * 3、一旦指定了扫描的包，就不会再扫描默认的包了，所以需要手动指定要扫描的所有包。
 */
@SpringBootApplication
@ComponentScan({
        "com.wnxy.sddfp.common",
        "com.wnxy.sddfp.system",
        "com.wnxy.sddfp.client.bank.fallback"
})
@MapperScan("com.wnxy.sddfp.system.mapper")
// 开启openfeign客户端调用注解支持
@EnableFeignClients(basePackages = "com.wnxy.sddfp.client.bank")
@EnableCircuitBreaker
public class SystemApplication {
    public static void main(String[] args) {
        SpringApplication.run(SystemApplication.class, args);
    }
}